<!doctype html>
<html lang="zh-cn">
<head>
    <meta name="viewport" content="initial-scale=1, user-scalable=0, minimal-ui" charset="UTF-8">
    <title>下拉刷新</title>
<style>
*{
    margin: 0;
    padding:0;
    -webkit-tap-highlight-color:rgba(0,0,0,0);
    -webkit-text-size-adjust:none;
}
html{
    font-size:10px;
}
body{
    background-color: #f5f5f5;
    font-size: 1.2em;
}
.outer{
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-direction:column;
    -webkit-box-orient:vertical;
    box-orient:vertical;
    -webkit-flex-direction:column;
    flex-direction:column;
}
.header{
    position: relative;
    height: 44px;
    line-height: 44px;
    border-bottom: 1px solid #ccc;
    background-color: #eee;
}
.header h1{
    text-align: center;
    font-size: 2rem;
    font-weight: normal;
}
.header .btn{
    position: absolute;
    right: 0;
    top: 0;
    width: 4em;
    height: 100%;
    text-align: center;
    color: #06c;
    font-size: 1.4rem;
    background-color: #ccc;
}
.header .btn:active{
    background-color: #aaa;
    color: #fff;
}
.inner{
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    background-color: #fff;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
}
.inner .item{
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align:center;
    -webkit-box-align:center;
    box-align:center;
    -webkit-align-items:center;
    align-items:center;
    padding:3.125%;
    border-bottom: 1px solid #ddd;
    color: #333;
}
.inner .item img{
    display: block;
    width: 40px;
    height: 40px;
    border:1px solid #ddd;
}
.inner .item h3{
    display: block;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    width: 100%;
    max-height: 40px;
    overflow: hidden;
    line-height: 20px;
    margin: 0 10px;
    font-size: 1.2rem;
}
.inner .item .date{
    display: block;
    height: 20px;
    line-height: 20px;
    color: #999;
}
.opacity{
    -webkit-animation: opacity 0.5s linear;
    animation: opacity 0.5s linear;
}
@-webkit-keyframes opacity {
    0% {
        opacity:0;
    }
    100% {
        opacity:1;
    }
}
@keyframes opacity {
    0% {
        opacity:0;
    }
    100% {
        opacity:1;
    }
}

/* dropload */
.dropload-up,.dropload-down{
    position: relative;
    height: 0;
    overflow: hidden;
    -webkit-transform:translate3d(0,0,0);
    transform:translate3d(0,0,0);
}
.dropload-refresh,.dropload-update,.dropload-load{
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 100%;
    height: 50px;
    line-height: 50px;
    text-align: center;
    -webkit-transform:translate(-50%,0);
    transform:translate(-50%,0);
}
.dropload-load .loading{
    display: inline-block;
    height: 15px;
    width: 15px;
    border-radius: 100%;
    margin: 6px;
    border: 2px solid #666;
    border-bottom-color: transparent;
    vertical-align: middle;
    -webkit-animation: rotate 0.75s 0 linear infinite;
    animation: rotate 0.75s 0 linear infinite;
}
@-webkit-keyframes rotate {
    0% {
        -webkit-transform: rotate(0deg);
    }
    50% {
        -webkit-transform: rotate(180deg);
    }
    100% {
        -webkit-transform: rotate(360deg);
    }
}
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(180deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

</style>
</head>
<body>
<div class="outer">
    <div class="header">
        <h1>头部</h1>
        <a href="javascript:;" class="btn lock">锁定</a>
    </div>
    <div class="inner">
        <div class="lists">
            <a class="item">
                <img src="http://d6.yihaodianimg.com/N02/M0B/81/5A/CgQCsVMhX_mAAvXsAAJDE3K2zh485900_80x80.jpg" alt="">
                <h3>1文字描述文字描述</h3>
                <span class="date">2014-14-14</span>
            </a>
            <a class="item">
                <img src="http://d6.yihaodianimg.com/N02/M0B/81/5A/CgQCsVMhX_mAAvXsAAJDE3K2zh485900_80x80.jpg" alt="">
                <h3>2文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述</h3>
                <span class="date">2014-14-14</span>
            </a>
            <a class="item">
                <img src="http://d6.yihaodianimg.com/N02/M0B/81/5A/CgQCsVMhX_mAAvXsAAJDE3K2zh485900_80x80.jpg" alt="">
                <h3>3文字描述文字描述文字描述文字描述文字描述</h3>
                <span class="date">2014-14-14</span>
            </a>
            <a class="item">
                <img src="http://d6.yihaodianimg.com/N02/M0B/81/5A/CgQCsVMhX_mAAvXsAAJDE3K2zh485900_80x80.jpg" alt="">
                <h3>4文字描述文字描述文字描述文字描述文字描述</h3>
                <span class="date">2014-14-14</span>
            </a>
            <a class="item">
                <img src="http://d6.yihaodianimg.com/N02/M0B/81/5A/CgQCsVMhX_mAAvXsAAJDE3K2zh485900_80x80.jpg" alt="">
                <h3>5文字描述文字描述文字描述文字描述文字描述</h3>
                <span class="date">2014-14-14</span>
            </a>
            <a class="item">
                <img src="http://d6.yihaodianimg.com/N02/M0B/81/5A/CgQCsVMhX_mAAvXsAAJDE3K2zh485900_80x80.jpg" alt="">
                <h3>6文字描述文字描述文字描述文字描述文字描述</h3>
                <span class="date">2014-14-14</span>
            </a>
            <a class="item">
                <img src="http://d6.yihaodianimg.com/N02/M0B/81/5A/CgQCsVMhX_mAAvXsAAJDE3K2zh485900_80x80.jpg" alt="">
                <h3>7文字描述文字描述文字描述文字描述文字描述</h3>
                <span class="date">2014-14-14</span>
            </a>
            <a class="item">
                <img src="http://d6.yihaodianimg.com/N02/M0B/81/5A/CgQCsVMhX_mAAvXsAAJDE3K2zh485900_80x80.jpg" alt="">
                <h3>8文字描述文字描述文字描述文字描述文字描述</h3>
                <span class="date">2014-14-14</span>
            </a>
            <a class="item">
                <img src="http://d6.yihaodianimg.com/N02/M0B/81/5A/CgQCsVMhX_mAAvXsAAJDE3K2zh485900_80x80.jpg" alt="">
                <h3>9文字描述文字描述文字描述文字描述文字描述</h3>
                <span class="date">2014-14-14</span>
            </a>
            <a class="item">
                <img src="http://d6.yihaodianimg.com/N02/M0B/81/5A/CgQCsVMhX_mAAvXsAAJDE3K2zh485900_80x80.jpg" alt="">
                <h3>10文字描述文字描述文字描述文字描述文字描述</h3>
                <span class="date">2014-14-14</span>
            </a>
            <a class="item">
                <img src="http://d6.yihaodianimg.com/N02/M0B/81/5A/CgQCsVMhX_mAAvXsAAJDE3K2zh485900_80x80.jpg" alt="">
                <h3>11文字描述文字描述文字描述文字描述文字描述</h3>
                <span class="date">2014-14-14</span>
            </a>
            <a class="item">
                <img src="http://d6.yihaodianimg.com/N02/M0B/81/5A/CgQCsVMhX_mAAvXsAAJDE3K2zh485900_80x80.jpg" alt="">
                <h3>12文字描述文字描述文字描述文字描述文字描述</h3>
                <span class="date">2014-14-14</span>
            </a>
        </div>
    </div>
</div>
<script src="js/zepto.min.js"></script>
<script src="../dist/dropload.min.js"></script>
<script>
// 按钮操作
$('.header .btn').on('click',function(){
    var $this = $(this);
    if(!!$this.hasClass('lock')){
        $this.attr('class','btn unlock');
        $this.text('解锁');
        // 锁定
        dropload.lock();
    }else{
        $this.attr('class','btn lock');
        $this.text('锁定');
        // 解锁
        dropload.unlock();
    }
});

// dropload
var dropload = $('.inner').dropload({
    domUp : {
        domClass   : 'dropload-up',
        domRefresh : '<div class="dropload-refresh">↓下拉刷新</div>',
        domUpdate  : '<div class="dropload-update">↑释放更新</div>',
        domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>'
    },
    domDown : {
        domClass   : 'dropload-down',
        domRefresh : '<div class="dropload-refresh">↑上拉加载更多</div>',
        domUpdate  : '<div class="dropload-update">↓释放加载</div>',
        domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>'
    },
    loadUpFn : function(me){
        alert('1');
		me.resetload();
    },
    loadDownFn : function(me){
        alert('2');
		me.resetload();
    }
});
</script>
</body>
</html>